import regeneratorRuntime from '../utils/runtime'
import {loading,toast} from '../utils/ajaxSetting'
import {wxHttp} from '../ajax/ajax'
//  新增班级
const squadSave = async ({...options})=>{
	return wxHttp({
		name: 'squad',
      	data: {
			$url: 'save',
			...options.data
		},
		loading: loading(options.loading),
		// loading: options.loading===false? false : loading(true),
		// toast: options.toast===false? false :toast(true)
	})
}

const squadList = async (options)=>{
	return wxHttp({
		name: 'squad',
      	data: {
			$url: 'list',
			...options
		},
		loading: loading(true),
	})
}
const squadOPenidList = async (options)=>{
	return wxHttp({
		name: 'squad',
      	data: {
			$url: 'getOPenidList'
		},
	})
}
const squadaddcaptain = async (options)=>{
	return wxHttp({
		name: 'squad',
      	data: {
			$url: 'addcaptain',
			...options
		},
		loading: loading(true),
	})
}
const squadDetail = async (options)=>{
	return wxHttp({
		name: 'squad',
      	data: {
			$url: 'detail',
			...options
		},
		loading: loading(true),
	})
}

export{
	squadSave,
	squadList,
	squadOPenidList,
	squadaddcaptain,
	squadDetail
}
